import request from '@/config/axios'

export interface WeTagGroupVO {
  groupId: string
  groupName: string
  order: number
}

// 查询标签分组列表
export const getWeTagGroupPage = async (params) => {
  return await request.get({ url: `/wecom/we-tag-group/page`, params })
}

// 查询标签分组详情
export const getWeTagGroup = async (id: number) => {
  return await request.get({ url: `/wecom/we-tag-group/get?id=` + id })
}

// 新增标签分组
export const createWeTagGroup = async (data: WeTagGroupVO) => {
  return await request.post({ url: `/wecom/we-tag-group/create`, data })
}

// 修改标签分组
export const updateWeTagGroup = async (data: WeTagGroupVO) => {
  return await request.put({ url: `/wecom/we-tag-group/update`, data })
}

// 删除标签分组
export const deleteWeTagGroup = async (id: number) => {
  return await request.delete({ url: `/wecom/we-tag-group/delete?id=` + id })
}

// 导出标签分组 Excel
export const exportWeTagGroup = async (params) => {
  return await request.download({ url: `/wecom/we-tag-group/export-excel`, params })
}
// 同步企业微信标签组
export const syncTags = async () => {
  return await request.post({ url: `/wecom/we-tag-group/sync-tags` })
}
